<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * index.php
 * @author ranuandra
 *
 * 7 Mei 2012 13:18:09
 *
 * 
 */
?>
<div class="content">
	<a href="<?php echo URL::base() ?>pengalaman/add" class="btn btn-primary">Tambah</a>
	<table class="table">
		<thead>
		<tr>
			<th>Bidang</th>
			<th>Industri</th>
			<th>Lama</th>
			<th>Institusi</th>
			<th>Contact</th>
			<th>Gaji Terakhir</th>
		</tr>
		</thead>
		<tbody>
<?php foreach($datas as $data)
		{
		?>
		<tr>
			<td><?php echo $data->mstbidang->bidang?></td>
			<td><?php echo $data->mstindustri->industri_type?></td>
			<td><?php 
				$diff = abs(strtotime($data->sampai_tanggal) - strtotime($data->dari_tanggal));
				
				$years = floor($diff / (365*60*60*24));
				$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
				$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));
			
				echo $years." th ". $months." bln";
			?></td>
			<td><?php echo $data->institusi?></td>
			<td><?php echo $data->cp?></td>
			<td><?php echo $data->gaji?></td>
		</tr>
		<?php 
		}
		?>
		</tbody>

	</table>
</div>